package com.sl.biz.modular.workflow.dao.service.impl;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sl.biz.modular.workflow.dao.domain.entity.WorkflowTaskLogDO;
import com.sl.biz.modular.workflow.dao.mapper.WorkflowTaskLogMapper;
import com.sl.biz.modular.workflow.dao.service.WorkflowTaskLogDaoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class WorkflowTaskLogDaoServiceImpl extends ServiceImpl<WorkflowTaskLogMapper, WorkflowTaskLogDO>  implements WorkflowTaskLogDaoService {

    @InterceptorIgnore(tenantLine = "true")
    @Override
    public WorkflowTaskLogDO getByInstanceIdAndTaskCode(String instanceId, String taskCode) {
        LambdaUpdateWrapper<WorkflowTaskLogDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
        lambdaUpdateWrapper.eq(WorkflowTaskLogDO::getWorkflowInstanceId, instanceId);
        lambdaUpdateWrapper.eq(WorkflowTaskLogDO::getTaskCode, taskCode);
        return super.getOne(lambdaUpdateWrapper);
    }
}
